package com.ktjy.ch01.web;

import com.ktjy.ch01.comm.Ktjiaoyulnfo;
import com.ktjy.ch01.service.DemoService;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
    @Resource
    private Ktjiaoyulnfo ktjiaoyulnfo;
    @Autowired
    private DemoService demoService;

    @RequestMapping("/hello")
    public String hello() {
        String msg = demoService.sayHello();
        msg += " " + ktjiaoyulnfo.getName()+" "+ktjiaoyulnfo.getEmail();
        return msg;
    }
}
